'''
Created on 31/10/2013

@author: jcrada
'''

import fl.TOLERANCE


import math

class Op(object):
    
    
        
    @staticmethod
    def isEq(a, b, tolerance=fl.TOLERANCE):
        return math.fabs(a - b) < tolerance
    
    @staticmethod
    def isLt(a,b,tolerance=fl.TOLERANCE):
        return not Op.isEq(a, b, tolerance) and a < b
    
    @staticmethod
    def isLE(a,b,tolerance=fl.TOLERANCE):
        return Op.isEq(a,b,tolerance) or a < b
    
    @staticmethod
    def isGt(a,b,tolerance=fl.TOLERANCE):
        return not Op.isEq(a, b, tolerance) and a > b
    
    @staticmethod
    def isGE(a,b,tolerance=fl.TOLERANCE):
        return Op.isEq(a, b, tolerance) or a > b
        
